// plugins/amap.client.ts
// 引入 AMapLoader 依赖包
import AMapLoader from '@amap/amap-jsapi-loader';
export default defineNuxtPlugin(async (nuxtApp) => {
  // 安全密钥
  ;window._AMapSecurityConfig = {
    securityJsCode: "「你申请的安全密钥」",
    serviceHost: '「你配置的安全密钥代理地址」'
  }
  console.log('mounted.window', window._AMapSecurityConfig)
  return {
    provide: {
      _AMap: await AMapLoader.load({
        key: '05642f94f0b700799263499eac462f3b',
        version: '2.0',
        plugins: ['PlaceSearch'],
      })
    }
  }
})
